{% let urls = urls %}
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>TODO List</title>
    </head>
    <body>
        <h1>TODO List</h1>
        <form id="todo-form"
              action="{{ cot::reverse!(urls, "add-todo")? }}"
              method="post">
            <input type="text"
                   id="title"
                   name="title"
                   placeholder="Enter a new TODO"
                   required>
            <button type="submit">Add TODO</button>
        </form>
        <ul id="todo-list">
            {% for todo in todo_items %}
                <li>
                    {% let todo_id = todo.id %}
                    <form action="{{ cot::reverse!(urls, "remove-todo", todo_id = todo_id)? }}"
                          method="post">
                        <span>{{ todo.title }}</span>
                        <button type="submit">Remove</button>
                    </form>
                </li>
            {% endfor %}
        </ul>
    </body>
</html>
